const chalk = require('chalk');
const { red, yellow, green, purple } = require('./color');

const log = console.log;
const redText = (...args)=>{
    return chalk.hex(red)(...args)
}
const yellowText = (...args)=>{
    return chalk.hex(yellow)(...args)
}
const greenText = (...args)=>{
    return chalk.hex(green)(...args)
}
const purpleText = (...args)=>{
    return chalk.hex(purple)(...args)
}
const error = (...args)=>{
    log(redText(...args))
}
const warn = (...args)=>{
    log(yellowText(...args))
}
const success = (...args)=>{
    log(greenText(...args))
}
const message = (...args)=>{
    log(purpleText(...args))
}
const logCustom = (color)=>{
    if(!color){
        error('color cannot be empty!')
        return;
    }
    return (...args)=>{
        log(chalk.hex(color)(...args))
    }
}
module.exports = {
    log,
    redText,
    yellowText,
    greenText,
    purpleText,
    error,
    warn,
    success,
    message,
    logCustom,
}